const curry = (...args1) => {
    let params = [...args1]
    const addFn = (...args2) => {
        params = [...params, ...args2]
        return addFn
    }
    addFn.valueOf = () => {
        return params.reduce((a,b) => {
            return a + b
        })
    }

    return addFn
}    


const add = (...agrs) => {
    const addFn = (...args1) => {
        agrs = [...agrs,...args1]
        return addFn
    }

    addFn.valueOf = () => {
        return agrs.reduce((a,b) => {
            return a + b
        })
    }
    return addFn
}


add(1,2,3).valueOf()
console.log(add(1,2,3).valueOf())